import {proxy} from 'valtio'

const history = proxy({
    name: 'history',
    data: [],
    add: (data) => {
        history.data = [...history.data, data]
    },
    remove: (id) => {
        history.data = history.data.filter(item => {
            return item.id !== id
        })
    }
})

export default history